/*
	op: 
		00/01 	= Left shift
		10		= Right shift,0 Filled
		11		= Right shift,with symbol extent
*/

module barrelShifterS
(
    input   wire    [63:00]         data_in,
    input   wire    [63:00]         shift2,
    input   wire    [01:00]         op,
    input   wire    [05:00]         shamt,
    output  wire    [63:00]         data_out
);
    //wire    [63:00]     shift2;
    wire    [63:00]     shift3;
    wire    [63:00]     shift4;
    wire    [63:00]     shift5;
/*
    assign shift2 = (
        (shamt[2])?
            (op[1]?{{4{data_in[63] & op[0]}},shift1[63:4]} : {shift1[59:00],4'b0}):
            (shift1)
    );
*/
    assign shift3 = (
        (shamt[3])?
            (op[1]?{{8{data_in[63] & op[0]}},shift2[63:8]} : {shift2[55:00],8'b0}):
            (shift2)
    );

    assign shift4 = (
        (shamt[4])?
            (op[1]?{{16{data_in[63] & op[0]}},shift3[63:16]} : {shift3[47:00],16'b0}):
            (shift3)
    );
    assign shift5 = (
        (shamt[5])?
            (op[1]?{{32{data_in[63] & op[0]}},shift4[63:32]} : {shift4[31:00],32'b0}):
            (shift4)
    );
    assign data_out = shift5;

endmodule

